package com.ghost.utils
{
	
	public class TimerUtils
	{
		public function TimerUtils()
		{
		}
		
		/**
		 * 获取年
		 */ 
		public static function today_getYear():Number
		{
			var dt:Date = new Date();
			return dt.getFullYear()
		}
		
		/**
		 * 获取月
		 */ 
		public static function today_getMonth():Number
		{
			var dt:Date = new Date();
			return dt.getMonth() + 1;
		}
		
		/**
		 * 获取天
		 */ 
		public static function today_getDay():Number
		{
			var dt:Date = new Date();
			return dt.getDate();
		}
		
		/**
		 *  小时 
		 */ 
		public static function today_getHour():Number
		{
			var dt:Date = new Date();
			return dt.getHours();
		}
		 
		 		
		/**
		 * 获取分钟
		 */ 
		public static function today_getMin():Number
		{
			var dt:Date = new Date();
			return dt.getMinutes();
		} 
		
		/**
		 * 获取秒
		 */ 
		public static function today_getSecond():Number
		{
			var dt:Date = new Date();
			return dt.getSeconds();
		}
		
		/**
		 * 星期
		 */ 
		public static function today_getDayUTC():String
		{
			var dt:Date = new Date();
			switch(dt.dayUTC)
			{
				case 0:
					return "星期日"
				break;
				case 1:
					return "星期一"
				break;
				case 2:
					return "星期二"
				break;
				case 3:
					return "星期三"
				break;
				case 4:
					return "星期四"
				break;
				case 5:
					return "星期五"
				break;
				case 6:
					return "星期六"
				break;
			}
			return '';
		}
		
		/**
		 * 获取年月日
		 */ 
		public static function getYear_month_day():String
		{
			return today_getYear() + '-' + today_getMonth() + '-' + today_getDay() ; 
		}
		/**
		 * 获取完整年月日时分秒2011.1.2 12:20:50  s sign
		 */		
		public static function get_full_date(million_sec:Number,sign_str:String='.'):String
		{
			var d:Date = new Date();
			var sb_num:Number = million_sec*1000-d.getTimezoneOffset() * 60 * 1000;
			d.setTime(sb_num);
			//var str:String = d.getFullYear()+sign_str+String(d.getMonth()+1)+sign_str+d.getDate()+' '+d.getHours()+':'+d.getMinutes()+':'+d.getSeconds();
			var str:String = d.getFullYear()+sign_str+String(d.getMonth()+1)+sign_str+d.getDate();
			return str;
		}
		
		
	}
}